<template>
	<view class="container">
		<view v-html="content">
		</view>
	</view>
</template>

<script>
	const app = getApp()
	import Http from "@/utils/http"
	const http = new Http()
	export default {
		data() {
			return {
				baseHttp: '',
				obj:null,
				content:''
			}
		},
		async onLoad(options) {
			this.baseHttp = app.globalData.baseHttp;
			await this.getInfo();
			if (options.type == undefined || options.type == 1) {
				uni.setNavigationBarTitle({
					title: "关于我们",
				})
				this.content = this.obj.we
			} else if (options.type == 2) {
				uni.setNavigationBarTitle({
					title: "更新公告"
				})
				this.content = this.obj.advertise
			} else {
				uni.setNavigationBarTitle({
					title: "练习客服"
				})
				this.content = this.obj.customer
			}
		},
		methods: {
			async getInfo(){
			let res = await	http.get('v1/advertise/list');
				
			if(res.data.code == 200){
				this.obj = res.data.data[0];
				console.log(this.obj);
			}else{
				uni.showToast({
					title:'网络出错了',
					icon:'none'
				})
			}
			}
		}
	}
</script>

<style scoped lang="scss">
.page {
	background: #f1f1f1;
}

.container {
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 5rpx; /* 设置相等的上下左右内边距 */
}
</style>